﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="category_list.ascx.cs" Inherits="Admin_Views_module_category_list" %>
<script type="text/javascript">
    //-----------------------------------------
    // Confirm Actions (delete, uninstall)
    //-----------------------------------------
    $(document).ready(function () {

        // Confirm Delete
        $('#form').submit(function () {
            if ($(this).attr('action').indexOf('delete', 1) != -1) {
                if (!confirm('test')) {
                    return false;
                }
            }
        });
    });
</script>
<form action="" method="post" enctype="multipart/form-data" id="form" runat="Server">
<div class="warning" id="warning" runat="Server" visible="false"><asp:label id="warningText" runat="server" /></div>
<div class="success" id="success" runat="Server" visible="false"><asp:label id="successText" runat="server" /></div>
<div class="box">
  <div class="left"></div>
  <div class="right"></div>
  <div class="heading">
    <h1 style="background-image: url('view/image/category.png');">Category</h1>
    <div class="buttons">
        <a href="default.aspx?action=category" class="button"><span>Thêm</span></a>
        <asp:Button id="delete" Text="Xóa" CssClass="button" runat="server" OnClientClick="$('#form').submit();" onclick="delete_Click" />
    </div>
  </div>
  <div class="content">
        <asp:datalist ID="CategoryList" runat="Server" CssClass="list">
            <HeaderTemplate>
                <thead>
                  <tr>
                    <td width="1" style="text-align: center;"><input type="checkbox" onclick="$('input[name*=\'selected\']').attr('checked', this.checked);" /></td>
                    <td class="left">Tên Danh mục</td>
                    <td class="right">Mô tả</td>
                    <td class="right">Công việc</td>
                  </tr>
                </thead>
                <tbody>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td style="text-align: center;">
                      <input type="checkbox" id='selected' value='<%# Eval("category_id") %>' runat="Server" />
                    </td>
                    <td class="left"><%# Eval("category_name") %></td>
                    <td class="right"><%# Eval("category_des") %></td>
                    <td class="right">
                      [ <a href='default.aspx?action=category&ID=<%# Eval("category_id") %>'>Sửa</a> ]
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </tbody>
            </FooterTemplate>
        </asp:datalist>
  </div>
</div>
</form>